<template>
<div class="">
    <button v-on:click="showMsg">查看</button>
    <h1>{{ count }}</h1>
    <button v-on:click="addCount">新增count的值</button>
    <button @click="count++">新增count的值2</button>
    <button v-on:click="ModCount">重置count的值</button>
    <button @click="count=0">重置count的值2</button>
</div>
</template>

<script setup>
import { ref } from 'vue';
const showMsg = () =>{
    console.log("count的值是:",count.value);
}
const count = ref(0)
const addCount = () =>{
    count.value++
}
const ModCount = () =>{
    count.value=0
}
</script>
<style scoped></style>
